API Documentation
Public Member Functions | List of all members
nkWinUi::FontManager Class Referencefinal

Manages the fonts in the component [WIP]. More...

Inheritance diagram for nkWinUi::FontManager:

Public Member Functions

FontgetDefaultFont () const
 
FontcreateOrRetrieve (const nkMemory::StringView &name)
 
Fontget (const nkMemory::StringView &name) const
 
FontgetByIndex (unsigned int index) const
 
void rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName)
 
void erase (const nkMemory::StringView &name)
 

Detailed Description

Manages the fonts in the component [WIP].

This is a WIP.

Member Function Documentation

◆ getDefaultFont()

Font* nkWinUi::FontManager::getDefaultFont ( ) const
Returns
The default font set.

◆ createOrRetrieve()

Font* nkWinUi::FontManager::createOrRetrieve ( const nkMemory::StringView name)

Creates if unavailable, or retrieves if available, a font.

Parameters
nameThe name of the font to retrieve.
Returns
The font requested, possibly freshly created. The manager owns the memory returned, external code should never delete it. See erase().

◆ get()

Font* nkWinUi::FontManager::get ( const nkMemory::StringView name) const

Retrieves a font.

Parameters
nameThe name of the font to retrieve.
Returns
The font requested if available, nullptr else.

◆ getByIndex()

Font* nkWinUi::FontManager::getByIndex ( unsigned int  index) const

Get a font, by index. Note that one index can map to a different font after memory is changed. Useful to loop over all available fonts in one go.

Parameters
indexThe index of the font to retrieve.
Returns
The font linked if available, nullptr else.

◆ rename()

void nkWinUi::FontManager::rename ( const nkMemory::StringView oldName,
const nkMemory::StringView newName 
)

Renames a font.

Parameters
oldNameThe name of the font to rename.
newNameThe name to reassign to the font.

◆ erase()

void nkWinUi::FontManager::erase ( const nkMemory::StringView name)

Erases and frees a font.

Parameters
nameThe name of the font to erase.

The documentation for this class was generated from the following file: